package com.hkyl.hospital.web.controller;

import com.hkyl.hospital.domain.ResultVo;
import com.hkyl.hospital.entity.PatientOperation;
import com.hkyl.hospital.service.PatientOperationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hyh
 * @date 2023/07/16 23:07:00
 */
@RestController
@RequestMapping("patientOperation")
public class PatientOperationController {

    @Autowired
    private PatientOperationService patientOperationService;

    @PostMapping("save")
    public ResultVo save(@RequestBody PatientOperation patientOperation){
        Integer rows = patientOperationService.save(patientOperation);
        return rows > 0 ? ResultVo.success("办理成功") : ResultVo.failure("办理失败");
    }
}
